$(function(){

	/*返回顶部-Start*/
	var getDiv=document.getElementById('back-to-top');
	getDiv.style.display="none";
	getDiv.onclick=function(){
		window.scrollTo(0,0);
	}
	window.onscroll=function(){
		if(document.documentElement.scrollTop){
			getDiv.style.display="block";
		}else if(document.body.scrollTop){
			getDiv.style.display="block";
		}else{
			getDiv.style.display="none";
	  }
	}
	/*返回顶部-End*/
	
	for (var id = 1; id<=2; id++) {
		var getMainMenu = document.getElementById('menu-content'+id);
		getMainMenu.onclick=function(){
			if(document.getElementById('main-menu').className != "collapse navbar-collapse"){
				document.getElementById('main-menu').setAttribute("class","collapse navbar-collapse");
			}
		}
	}

	$(".go-back-index").click(function(){
		window.location.reload();
	});

	/*显示我的课程*/
	$(".show_course").click(function(){
		showMyClass();
	});
	$(".my-class-title").click(function(){
		showMyClass();
	});

	/*显示今日课堂*/
	$(".show_today_course").click(function(){
		showTodayClass();
		getLesson();
	});

	$(".today-class-title").click(function(){
		showTodayClass();
		getLesson();
	});

});

var showTodayClass = function(){
	
	$(".today-class-title").addClass("ca");
	$(".today-class-list").show();

	$(".my-class-title").removeClass("ca");
	$(".my-class-list").hide();
}

var showMyClass = function(){

	$(".my-class-title").addClass("ca");
	$(".my-class-list").show();
	
	$(".today-class-title").removeClass("ca");
	$(".today-class-list").hide();
}
